﻿using blackhouse.BlackApart.Business.Opinions;
using blackhouse.BlackApart.Web;
using blackhouse.BlackApart.Web.Navigation;
using blackhouse.mojoPortalExtend;
using mojoPortal.Business;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace blackhouse.StareKino.Web.Navigation {
    public class OpinionUrlVisitor : UrlVisitor, IOpinionVisitor {

        public void Apply(IOpinion opinion) {
            OpinionUrl url = new OpinionUrl(opinion);
            if (!url.HaveUrl)
                url.CreateUrl();
            this.Url = PageProvider.AdjustUrlToCurrentSite(url.GetUrl().ReplaceEx("~/", "/"));
        }

    }
}